{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "0bd9a00d",
   "metadata": {},
   "source": [
    "# Pandas 查看数据方法详解\n",
    "\n",
    "本教程详细介绍 Pandas 中用于查看数据的各种方法，帮助你快速了解数据集的基本信息。\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "id": "4693d90e",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "数据集已创建！\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/var/folders/9b/jb3nnnqn60x3dtlll6mcf0000000gp/T/ipykernel_40637/2995257336.py:11: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  '入职日期': pd.date_range('2020-01-01', periods=10, freq='M'),\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>姓名</th>\n",
       "      <th>年龄</th>\n",
       "      <th>工资</th>\n",
       "      <th>部门</th>\n",
       "      <th>入职日期</th>\n",
       "      <th>绩效评分</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>张三</td>\n",
       "      <td>25</td>\n",
       "      <td>5000</td>\n",
       "      <td>技术</td>\n",
       "      <td>2020-01-31</td>\n",
       "      <td>3.749080</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>李四</td>\n",
       "      <td>30</td>\n",
       "      <td>8000</td>\n",
       "      <td>销售</td>\n",
       "      <td>2020-02-29</td>\n",
       "      <td>4.901429</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>王五</td>\n",
       "      <td>35</td>\n",
       "      <td>12000</td>\n",
       "      <td>技术</td>\n",
       "      <td>2020-03-31</td>\n",
       "      <td>4.463988</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>赵六</td>\n",
       "      <td>28</td>\n",
       "      <td>6000</td>\n",
       "      <td>人事</td>\n",
       "      <td>2020-04-30</td>\n",
       "      <td>4.197317</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>钱七</td>\n",
       "      <td>32</td>\n",
       "      <td>9500</td>\n",
       "      <td>销售</td>\n",
       "      <td>2020-05-31</td>\n",
       "      <td>3.312037</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>孙八</td>\n",
       "      <td>27</td>\n",
       "      <td>5500</td>\n",
       "      <td>技术</td>\n",
       "      <td>2020-06-30</td>\n",
       "      <td>3.311989</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>周九</td>\n",
       "      <td>29</td>\n",
       "      <td>7200</td>\n",
       "      <td>人事</td>\n",
       "      <td>2020-07-31</td>\n",
       "      <td>3.116167</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>吴十</td>\n",
       "      <td>31</td>\n",
       "      <td>8800</td>\n",
       "      <td>销售</td>\n",
       "      <td>2020-08-31</td>\n",
       "      <td>4.732352</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>郑一</td>\n",
       "      <td>26</td>\n",
       "      <td>4800</td>\n",
       "      <td>技术</td>\n",
       "      <td>2020-09-30</td>\n",
       "      <td>4.202230</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>王二</td>\n",
       "      <td>33</td>\n",
       "      <td>10000</td>\n",
       "      <td>销售</td>\n",
       "      <td>2020-10-31</td>\n",
       "      <td>4.416145</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   姓名  年龄     工资  部门       入职日期      绩效评分\n",
       "0  张三  25   5000  技术 2020-01-31  3.749080\n",
       "1  李四  30   8000  销售 2020-02-29  4.901429\n",
       "2  王五  35  12000  技术 2020-03-31  4.463988\n",
       "3  赵六  28   6000  人事 2020-04-30  4.197317\n",
       "4  钱七  32   9500  销售 2020-05-31  3.312037\n",
       "5  孙八  27   5500  技术 2020-06-30  3.311989\n",
       "6  周九  29   7200  人事 2020-07-31  3.116167\n",
       "7  吴十  31   8800  销售 2020-08-31  4.732352\n",
       "8  郑一  26   4800  技术 2020-09-30  4.202230\n",
       "9  王二  33  10000  销售 2020-10-31  4.416145"
      ]
     },
     "execution_count": 28,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import pandas as pd\n",
    "import numpy as np\n",
    "\n",
    "# 创建示例数据集\n",
    "np.random.seed(42)\n",
    "data = {\n",
    "    '姓名': ['张三', '李四', '王五', '赵六', '钱七', '孙八', '周九', '吴十', '郑一', '王二'],\n",
    "    '年龄': [25, 30, 35, 28, 32, 27, 29, 31, 26, 33],\n",
    "    '工资': [5000, 8000, 12000, 6000, 9500, 5500, 7200, 8800, 4800, 10000],\n",
    "    '部门': ['技术', '销售', '技术', '人事', '销售', '技术', '人事', '销售', '技术', '销售'],\n",
    "    '入职日期': pd.date_range('2020-01-01', periods=10, freq='M'),\n",
    "    '绩效评分': np.random.uniform(3.0, 5.0, 10)\n",
    "}\n",
    "\n",
    "df = pd.DataFrame(data)\n",
    "print(\"数据集已创建！\")\n",
    "df\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "adc36931",
   "metadata": {},
   "source": [
    "## 1. `.head()` - 查看前几行数据\n",
    "\n",
    "`.head(n)` 方法用于查看 DataFrame 的前 n 行数据，默认显示前 5 行。\n",
    "\n",
    "**语法：** `DataFrame.head(n=5)`\n",
    "\n",
    "**参数：**\n",
    "- `n`: 要显示的行数，默认为 5\n",
    "\n",
    "**适用场景：**\n",
    "- 快速查看数据集的开头部分\n",
    "- 检查数据格式是否正确\n",
    "- 预览数据内容\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "2defc060",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "=== 默认查看前5行 ===\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>姓名</th>\n",
       "      <th>年龄</th>\n",
       "      <th>工资</th>\n",
       "      <th>部门</th>\n",
       "      <th>入职日期</th>\n",
       "      <th>绩效评分</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>张三</td>\n",
       "      <td>25</td>\n",
       "      <td>5000</td>\n",
       "      <td>技术</td>\n",
       "      <td>2020-01-31</td>\n",
       "      <td>3.749080</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>李四</td>\n",
       "      <td>30</td>\n",
       "      <td>8000</td>\n",
       "      <td>销售</td>\n",
       "      <td>2020-02-29</td>\n",
       "      <td>4.901429</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>王五</td>\n",
       "      <td>35</td>\n",
       "      <td>12000</td>\n",
       "      <td>技术</td>\n",
       "      <td>2020-03-31</td>\n",
       "      <td>4.463988</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>赵六</td>\n",
       "      <td>28</td>\n",
       "      <td>6000</td>\n",
       "      <td>人事</td>\n",
       "      <td>2020-04-30</td>\n",
       "      <td>4.197317</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>钱七</td>\n",
       "      <td>32</td>\n",
       "      <td>9500</td>\n",
       "      <td>销售</td>\n",
       "      <td>2020-05-31</td>\n",
       "      <td>3.312037</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   姓名  年龄     工资  部门       入职日期      绩效评分\n",
       "0  张三  25   5000  技术 2020-01-31  3.749080\n",
       "1  李四  30   8000  销售 2020-02-29  4.901429\n",
       "2  王五  35  12000  技术 2020-03-31  4.463988\n",
       "3  赵六  28   6000  人事 2020-04-30  4.197317\n",
       "4  钱七  32   9500  销售 2020-05-31  3.312037"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 默认查看前5行\n",
    "print(\"=== 默认查看前5行 ===\")\n",
    "df.head()\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "7827a40f",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "=== 查看前3行 ===\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>姓名</th>\n",
       "      <th>年龄</th>\n",
       "      <th>工资</th>\n",
       "      <th>部门</th>\n",
       "      <th>入职日期</th>\n",
       "      <th>绩效评分</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>张三</td>\n",
       "      <td>25</td>\n",
       "      <td>5000</td>\n",
       "      <td>技术</td>\n",
       "      <td>2020-01-31</td>\n",
       "      <td>3.749080</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>李四</td>\n",
       "      <td>30</td>\n",
       "      <td>8000</td>\n",
       "      <td>销售</td>\n",
       "      <td>2020-02-29</td>\n",
       "      <td>4.901429</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>王五</td>\n",
       "      <td>35</td>\n",
       "      <td>12000</td>\n",
       "      <td>技术</td>\n",
       "      <td>2020-03-31</td>\n",
       "      <td>4.463988</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   姓名  年龄     工资  部门       入职日期      绩效评分\n",
       "0  张三  25   5000  技术 2020-01-31  3.749080\n",
       "1  李四  30   8000  销售 2020-02-29  4.901429\n",
       "2  王五  35  12000  技术 2020-03-31  4.463988"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 查看前3行\n",
    "print(\"=== 查看前3行 ===\")\n",
    "df.head(3)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "c859cb73",
   "metadata": {},
   "source": [
    "## 2. `.tail()` - 查看后几行数据\n",
    "\n",
    "`.tail(n)` 方法用于查看 DataFrame 的后 n 行数据，默认显示后 5 行。\n",
    "\n",
    "**语法：** `DataFrame.tail(n=5)`\n",
    "\n",
    "**参数：**\n",
    "- `n`: 要显示的行数，默认为 5\n",
    "\n",
    "**适用场景：**\n",
    "- 快速查看数据集的末尾部分\n",
    "- 检查数据的完整性\n",
    "- 查看最近的数据记录\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "364875ee",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "=== 默认查看后5行 ===\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>姓名</th>\n",
       "      <th>年龄</th>\n",
       "      <th>工资</th>\n",
       "      <th>部门</th>\n",
       "      <th>入职日期</th>\n",
       "      <th>绩效评分</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>孙八</td>\n",
       "      <td>27</td>\n",
       "      <td>5500</td>\n",
       "      <td>技术</td>\n",
       "      <td>2020-06-30</td>\n",
       "      <td>3.311989</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>周九</td>\n",
       "      <td>29</td>\n",
       "      <td>7200</td>\n",
       "      <td>人事</td>\n",
       "      <td>2020-07-31</td>\n",
       "      <td>3.116167</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>吴十</td>\n",
       "      <td>31</td>\n",
       "      <td>8800</td>\n",
       "      <td>销售</td>\n",
       "      <td>2020-08-31</td>\n",
       "      <td>4.732352</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>郑一</td>\n",
       "      <td>26</td>\n",
       "      <td>4800</td>\n",
       "      <td>技术</td>\n",
       "      <td>2020-09-30</td>\n",
       "      <td>4.202230</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>王二</td>\n",
       "      <td>33</td>\n",
       "      <td>10000</td>\n",
       "      <td>销售</td>\n",
       "      <td>2020-10-31</td>\n",
       "      <td>4.416145</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   姓名  年龄     工资  部门       入职日期      绩效评分\n",
       "5  孙八  27   5500  技术 2020-06-30  3.311989\n",
       "6  周九  29   7200  人事 2020-07-31  3.116167\n",
       "7  吴十  31   8800  销售 2020-08-31  4.732352\n",
       "8  郑一  26   4800  技术 2020-09-30  4.202230\n",
       "9  王二  33  10000  销售 2020-10-31  4.416145"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 默认查看后5行\n",
    "print(\"=== 默认查看后5行 ===\")\n",
    "df.tail()\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "0d4fe244",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "=== 查看后3行 ===\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>姓名</th>\n",
       "      <th>年龄</th>\n",
       "      <th>工资</th>\n",
       "      <th>部门</th>\n",
       "      <th>入职日期</th>\n",
       "      <th>绩效评分</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>吴十</td>\n",
       "      <td>31</td>\n",
       "      <td>8800</td>\n",
       "      <td>销售</td>\n",
       "      <td>2020-08-31</td>\n",
       "      <td>4.732352</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>郑一</td>\n",
       "      <td>26</td>\n",
       "      <td>4800</td>\n",
       "      <td>技术</td>\n",
       "      <td>2020-09-30</td>\n",
       "      <td>4.202230</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>王二</td>\n",
       "      <td>33</td>\n",
       "      <td>10000</td>\n",
       "      <td>销售</td>\n",
       "      <td>2020-10-31</td>\n",
       "      <td>4.416145</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   姓名  年龄     工资  部门       入职日期      绩效评分\n",
       "7  吴十  31   8800  销售 2020-08-31  4.732352\n",
       "8  郑一  26   4800  技术 2020-09-30  4.202230\n",
       "9  王二  33  10000  销售 2020-10-31  4.416145"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 查看后3行\n",
    "print(\"=== 查看后3行 ===\")\n",
    "df.tail(3)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "4cca15ba",
   "metadata": {},
   "source": [
    "## 3. `.info()` - 查看数据集的详细信息\n",
    "\n",
    "`.info()` 方法提供了关于 DataFrame 的详细信息，包括：\n",
    "- 数据类型（dtype）\n",
    "- 非空值数量（Non-Null Count）\n",
    "- 内存使用情况\n",
    "\n",
    "**语法：** `DataFrame.info(verbose=None, buf=None, max_cols=None, memory_usage=None, null_counts=None)`\n",
    "\n",
    "**常用参数：**\n",
    "- `verbose`: 是否显示所有列的详细信息，True/False\n",
    "- `memory_usage`: 是否显示内存使用情况，'deep'/'True'/'False'\n",
    "\n",
    "**适用场景：**\n",
    "- 检查数据类型是否正确\n",
    "- 发现缺失值（通过 Non-Null Count）\n",
    "- 了解数据集的大小和内存占用\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "33c9532c",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "=== 数据集基本信息 ===\n",
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 10 entries, 0 to 9\n",
      "Data columns (total 6 columns):\n",
      " #   Column  Non-Null Count  Dtype         \n",
      "---  ------  --------------  -----         \n",
      " 0   姓名      10 non-null     object        \n",
      " 1   年龄      10 non-null     int64         \n",
      " 2   工资      10 non-null     int64         \n",
      " 3   部门      10 non-null     object        \n",
      " 4   入职日期    10 non-null     datetime64[ns]\n",
      " 5   绩效评分    10 non-null     float64       \n",
      "dtypes: datetime64[ns](1), float64(1), int64(2), object(2)\n",
      "memory usage: 608.0+ bytes\n"
     ]
    }
   ],
   "source": [
    "# 基本用法 - 查看数据集信息\n",
    "print(\"=== 数据集基本信息 ===\")\n",
    "df.info()\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "461257ee",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "=== 包含缺失值的数据集信息 ===\n",
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 10 entries, 0 to 9\n",
      "Data columns (total 6 columns):\n",
      " #   Column  Non-Null Count  Dtype         \n",
      "---  ------  --------------  -----         \n",
      " 0   姓名      10 non-null     object        \n",
      " 1   年龄      9 non-null      float64       \n",
      " 2   工资      9 non-null      float64       \n",
      " 3   部门      9 non-null      object        \n",
      " 4   入职日期    10 non-null     datetime64[ns]\n",
      " 5   绩效评分    10 non-null     float64       \n",
      "dtypes: datetime64[ns](1), float64(3), object(2)\n",
      "memory usage: 608.0+ bytes\n"
     ]
    }
   ],
   "source": [
    "# 添加缺失值来演示 info() 的缺失值检测功能\n",
    "df_with_missing = df.copy()\n",
    "df_with_missing.loc[0, '年龄'] = None\n",
    "df_with_missing.loc[1, '工资'] = None\n",
    "df_with_missing.loc[2, '部门'] = None\n",
    "\n",
    "print(\"=== 包含缺失值的数据集信息 ===\")\n",
    "df_with_missing.info()\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "689d388e",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "=== 详细内存使用情况 ===\n",
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 10 entries, 0 to 9\n",
      "Data columns (total 6 columns):\n",
      " #   Column  Non-Null Count  Dtype         \n",
      "---  ------  --------------  -----         \n",
      " 0   姓名      10 non-null     object        \n",
      " 1   年龄      10 non-null     int64         \n",
      " 2   工资      10 non-null     int64         \n",
      " 3   部门      10 non-null     object        \n",
      " 4   入职日期    10 non-null     datetime64[ns]\n",
      " 5   绩效评分    10 non-null     float64       \n",
      "dtypes: datetime64[ns](1), float64(1), int64(2), object(2)\n",
      "memory usage: 2.1 KB\n"
     ]
    }
   ],
   "source": [
    "# 详细内存使用情况\n",
    "print(\"=== 详细内存使用情况 ===\")\n",
    "df.info(memory_usage='deep')\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "8bc3cfbc",
   "metadata": {},
   "source": [
    "## 4. `.describe()` - 生成描述性统计信息\n",
    "\n",
    "`.describe()` 方法生成数值型列的描述性统计摘要，包括：\n",
    "- **count**: 非空值数量\n",
    "- **mean**: 平均值\n",
    "- **std**: 标准差\n",
    "- **min**: 最小值\n",
    "- **25%**: 第一四分位数（Q1）\n",
    "- **50%**: 中位数（Q2）\n",
    "- **75%**: 第三四分位数（Q3）\n",
    "- **max**: 最大值\n",
    "\n",
    "**语法：** `DataFrame.describe(percentiles=None, include=None, exclude=None)`\n",
    "\n",
    "**常用参数：**\n",
    "- `percentiles`: 要包含的百分位数，默认 [.25, .5, .75]\n",
    "- `include`: 要包含的数据类型，如 'all', 'object', 'number'\n",
    "- `exclude`: 要排除的数据类型\n",
    "\n",
    "**适用场景：**\n",
    "- 快速了解数值型数据的分布情况\n",
    "- 发现异常值（通过最大值、最小值）\n",
    "- 了解数据的集中趋势和离散程度\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "96381454",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "=== 数值型列的统计信息 ===\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>年龄</th>\n",
       "      <th>工资</th>\n",
       "      <th>入职日期</th>\n",
       "      <th>绩效评分</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>count</th>\n",
       "      <td>10.000000</td>\n",
       "      <td>10.000000</td>\n",
       "      <td>10</td>\n",
       "      <td>10.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>mean</th>\n",
       "      <td>29.600000</td>\n",
       "      <td>7680.000000</td>\n",
       "      <td>2020-06-15 07:12:00</td>\n",
       "      <td>4.040273</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>min</th>\n",
       "      <td>25.000000</td>\n",
       "      <td>4800.000000</td>\n",
       "      <td>2020-01-31 00:00:00</td>\n",
       "      <td>3.116167</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25%</th>\n",
       "      <td>27.250000</td>\n",
       "      <td>5625.000000</td>\n",
       "      <td>2020-04-07 12:00:00</td>\n",
       "      <td>3.421298</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>50%</th>\n",
       "      <td>29.500000</td>\n",
       "      <td>7600.000000</td>\n",
       "      <td>2020-06-15 00:00:00</td>\n",
       "      <td>4.199773</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>75%</th>\n",
       "      <td>31.750000</td>\n",
       "      <td>9325.000000</td>\n",
       "      <td>2020-08-23 06:00:00</td>\n",
       "      <td>4.452027</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>max</th>\n",
       "      <td>35.000000</td>\n",
       "      <td>12000.000000</td>\n",
       "      <td>2020-10-31 00:00:00</td>\n",
       "      <td>4.901429</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>std</th>\n",
       "      <td>3.204164</td>\n",
       "      <td>2403.608398</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.631731</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "              年龄            工资                 入职日期       绩效评分\n",
       "count  10.000000     10.000000                   10  10.000000\n",
       "mean   29.600000   7680.000000  2020-06-15 07:12:00   4.040273\n",
       "min    25.000000   4800.000000  2020-01-31 00:00:00   3.116167\n",
       "25%    27.250000   5625.000000  2020-04-07 12:00:00   3.421298\n",
       "50%    29.500000   7600.000000  2020-06-15 00:00:00   4.199773\n",
       "75%    31.750000   9325.000000  2020-08-23 06:00:00   4.452027\n",
       "max    35.000000  12000.000000  2020-10-31 00:00:00   4.901429\n",
       "std     3.204164   2403.608398                  NaN   0.631731"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 基本用法 - 只显示数值型列的统计信息（默认）\n",
    "print(\"=== 数值型列的统计信息 ===\")\n",
    "df.describe()\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "ad86548d",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "=== 所有列的统计信息 ===\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>姓名</th>\n",
       "      <th>年龄</th>\n",
       "      <th>工资</th>\n",
       "      <th>部门</th>\n",
       "      <th>入职日期</th>\n",
       "      <th>绩效评分</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>count</th>\n",
       "      <td>10</td>\n",
       "      <td>10.000000</td>\n",
       "      <td>10.000000</td>\n",
       "      <td>10</td>\n",
       "      <td>10</td>\n",
       "      <td>10.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>unique</th>\n",
       "      <td>10</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>top</th>\n",
       "      <td>张三</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>技术</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>freq</th>\n",
       "      <td>1</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>4</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>mean</th>\n",
       "      <td>NaN</td>\n",
       "      <td>29.600000</td>\n",
       "      <td>7680.000000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2020-06-15 07:12:00</td>\n",
       "      <td>4.040273</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>min</th>\n",
       "      <td>NaN</td>\n",
       "      <td>25.000000</td>\n",
       "      <td>4800.000000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2020-01-31 00:00:00</td>\n",
       "      <td>3.116167</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25%</th>\n",
       "      <td>NaN</td>\n",
       "      <td>27.250000</td>\n",
       "      <td>5625.000000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2020-04-07 12:00:00</td>\n",
       "      <td>3.421298</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>50%</th>\n",
       "      <td>NaN</td>\n",
       "      <td>29.500000</td>\n",
       "      <td>7600.000000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2020-06-15 00:00:00</td>\n",
       "      <td>4.199773</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>75%</th>\n",
       "      <td>NaN</td>\n",
       "      <td>31.750000</td>\n",
       "      <td>9325.000000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2020-08-23 06:00:00</td>\n",
       "      <td>4.452027</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>max</th>\n",
       "      <td>NaN</td>\n",
       "      <td>35.000000</td>\n",
       "      <td>12000.000000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2020-10-31 00:00:00</td>\n",
       "      <td>4.901429</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>std</th>\n",
       "      <td>NaN</td>\n",
       "      <td>3.204164</td>\n",
       "      <td>2403.608398</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.631731</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "         姓名         年龄            工资   部门                 入职日期       绩效评分\n",
       "count    10  10.000000     10.000000   10                   10  10.000000\n",
       "unique   10        NaN           NaN    3                  NaN        NaN\n",
       "top      张三        NaN           NaN   技术                  NaN        NaN\n",
       "freq      1        NaN           NaN    4                  NaN        NaN\n",
       "mean    NaN  29.600000   7680.000000  NaN  2020-06-15 07:12:00   4.040273\n",
       "min     NaN  25.000000   4800.000000  NaN  2020-01-31 00:00:00   3.116167\n",
       "25%     NaN  27.250000   5625.000000  NaN  2020-04-07 12:00:00   3.421298\n",
       "50%     NaN  29.500000   7600.000000  NaN  2020-06-15 00:00:00   4.199773\n",
       "75%     NaN  31.750000   9325.000000  NaN  2020-08-23 06:00:00   4.452027\n",
       "max     NaN  35.000000  12000.000000  NaN  2020-10-31 00:00:00   4.901429\n",
       "std     NaN   3.204164   2403.608398  NaN                  NaN   0.631731"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 包含所有列（包括字符串列）\n",
    "print(\"=== 所有列的统计信息 ===\")\n",
    "df.describe(include='all')\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "fe7e5b6b",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "=== 自定义百分位数 ===\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>年龄</th>\n",
       "      <th>工资</th>\n",
       "      <th>入职日期</th>\n",
       "      <th>绩效评分</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>count</th>\n",
       "      <td>10.000000</td>\n",
       "      <td>10.000000</td>\n",
       "      <td>10</td>\n",
       "      <td>10.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>mean</th>\n",
       "      <td>29.600000</td>\n",
       "      <td>7680.000000</td>\n",
       "      <td>2020-06-15 07:12:00</td>\n",
       "      <td>4.040273</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>min</th>\n",
       "      <td>25.000000</td>\n",
       "      <td>4800.000000</td>\n",
       "      <td>2020-01-31 00:00:00</td>\n",
       "      <td>3.116167</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10%</th>\n",
       "      <td>25.900000</td>\n",
       "      <td>4980.000000</td>\n",
       "      <td>2020-02-26 02:24:00</td>\n",
       "      <td>3.292407</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>30%</th>\n",
       "      <td>27.700000</td>\n",
       "      <td>5850.000000</td>\n",
       "      <td>2020-04-21 00:00:00</td>\n",
       "      <td>3.617967</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>50%</th>\n",
       "      <td>29.500000</td>\n",
       "      <td>7600.000000</td>\n",
       "      <td>2020-06-15 00:00:00</td>\n",
       "      <td>4.199773</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>70%</th>\n",
       "      <td>31.300000</td>\n",
       "      <td>9010.000000</td>\n",
       "      <td>2020-08-09 07:12:00</td>\n",
       "      <td>4.430498</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>90%</th>\n",
       "      <td>33.200000</td>\n",
       "      <td>10200.000000</td>\n",
       "      <td>2020-10-03 02:24:00</td>\n",
       "      <td>4.749260</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>max</th>\n",
       "      <td>35.000000</td>\n",
       "      <td>12000.000000</td>\n",
       "      <td>2020-10-31 00:00:00</td>\n",
       "      <td>4.901429</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>std</th>\n",
       "      <td>3.204164</td>\n",
       "      <td>2403.608398</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.631731</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "              年龄            工资                 入职日期       绩效评分\n",
       "count  10.000000     10.000000                   10  10.000000\n",
       "mean   29.600000   7680.000000  2020-06-15 07:12:00   4.040273\n",
       "min    25.000000   4800.000000  2020-01-31 00:00:00   3.116167\n",
       "10%    25.900000   4980.000000  2020-02-26 02:24:00   3.292407\n",
       "30%    27.700000   5850.000000  2020-04-21 00:00:00   3.617967\n",
       "50%    29.500000   7600.000000  2020-06-15 00:00:00   4.199773\n",
       "70%    31.300000   9010.000000  2020-08-09 07:12:00   4.430498\n",
       "90%    33.200000  10200.000000  2020-10-03 02:24:00   4.749260\n",
       "max    35.000000  12000.000000  2020-10-31 00:00:00   4.901429\n",
       "std     3.204164   2403.608398                  NaN   0.631731"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 自定义百分位数\n",
    "print(\"=== 自定义百分位数 ===\")\n",
    "df.describe(percentiles=[0.1, 0.3, 0.5, 0.7, 0.9])\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "3c940c3c",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "=== 年龄和工资的统计信息 ===\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>年龄</th>\n",
       "      <th>工资</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>count</th>\n",
       "      <td>10.000000</td>\n",
       "      <td>10.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>mean</th>\n",
       "      <td>29.600000</td>\n",
       "      <td>7680.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>std</th>\n",
       "      <td>3.204164</td>\n",
       "      <td>2403.608398</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>min</th>\n",
       "      <td>25.000000</td>\n",
       "      <td>4800.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25%</th>\n",
       "      <td>27.250000</td>\n",
       "      <td>5625.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>50%</th>\n",
       "      <td>29.500000</td>\n",
       "      <td>7600.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>75%</th>\n",
       "      <td>31.750000</td>\n",
       "      <td>9325.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>max</th>\n",
       "      <td>35.000000</td>\n",
       "      <td>12000.000000</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "              年龄            工资\n",
       "count  10.000000     10.000000\n",
       "mean   29.600000   7680.000000\n",
       "std     3.204164   2403.608398\n",
       "min    25.000000   4800.000000\n",
       "25%    27.250000   5625.000000\n",
       "50%    29.500000   7600.000000\n",
       "75%    31.750000   9325.000000\n",
       "max    35.000000  12000.000000"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 只查看特定列的统计信息\n",
    "print(\"=== 年龄和工资的统计信息 ===\")\n",
    "df[['年龄', '工资']].describe()\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "93beebdf",
   "metadata": {},
   "source": [
    "## 5. 其他常用查看方法\n",
    "\n",
    "### 5.1 `.shape` - 查看数据维度\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "94191f17",
   "metadata": {},
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "0886508d",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "数据集形状: (10, 6)\n",
      "行数: 10\n",
      "列数: 6\n"
     ]
    }
   ],
   "source": [
    "# 查看数据集的形状（行数, 列数）\n",
    "print(f\"数据集形状: {df.shape}\")\n",
    "print(f\"行数: {df.shape[0]}\")\n",
    "print(f\"列数: {df.shape[1]}\")\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "c22c420d",
   "metadata": {},
   "source": [
    "### 5.2 `.dtypes` - 查看各列的数据类型\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "535f3897",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "=== 各列数据类型 ===\n",
      "姓名              object\n",
      "年龄               int64\n",
      "工资               int64\n",
      "部门              object\n",
      "入职日期    datetime64[ns]\n",
      "绩效评分           float64\n",
      "dtype: object\n",
      "\n",
      "=== 数据类型详细信息 ===\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "姓名              object\n",
       "年龄               int64\n",
       "工资               int64\n",
       "部门              object\n",
       "入职日期    datetime64[ns]\n",
       "绩效评分           float64\n",
       "dtype: object"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 查看各列的数据类型\n",
    "print(\"=== 各列数据类型 ===\")\n",
    "print(df.dtypes)\n",
    "print(\"\\n=== 数据类型详细信息 ===\")\n",
    "df.dtypes\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "604a48ef",
   "metadata": {},
   "source": [
    "### 5.3 `.columns` - 查看列名\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "a563b379",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "=== 所有列名 ===\n",
      "['姓名', '年龄', '工资', '部门', '入职日期', '绩效评分']\n",
      "\n",
      "列名数量: 6\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "Index(['姓名', '年龄', '工资', '部门', '入职日期', '绩效评分'], dtype='object')"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 查看所有列名\n",
    "print(\"=== 所有列名 ===\")\n",
    "print(df.columns.tolist())\n",
    "print(f\"\\n列名数量: {len(df.columns)}\")\n",
    "df.columns\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "481d65ca",
   "metadata": {},
   "source": [
    "### 5.4 `.index` - 查看索引\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "c5168ccc",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "=== 索引信息 ===\n",
      "索引类型: <class 'pandas.core.indexes.range.RangeIndex'>\n",
      "索引范围: 0 到 9\n",
      "索引步长: 1\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "RangeIndex(start=0, stop=10, step=1)"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 查看索引\n",
    "print(\"=== 索引信息 ===\")\n",
    "print(f\"索引类型: {type(df.index)}\")\n",
    "print(f\"索引范围: {df.index.start} 到 {df.index.stop-1}\")\n",
    "print(f\"索引步长: {df.index.step}\")\n",
    "df.index\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "35f5fad8",
   "metadata": {},
   "source": [
    "### 5.5 `.isnull()` 和 `.notnull()` - 检查缺失值\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "4185ecfa",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "=== 缺失值检查（True表示缺失） ===\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>姓名</th>\n",
       "      <th>年龄</th>\n",
       "      <th>工资</th>\n",
       "      <th>部门</th>\n",
       "      <th>入职日期</th>\n",
       "      <th>绩效评分</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>False</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "      姓名     年龄     工资     部门   入职日期   绩效评分\n",
       "0  False   True  False  False  False  False\n",
       "1  False  False   True  False  False  False\n",
       "2  False  False  False  False  False  False\n",
       "3  False  False  False  False  False  False\n",
       "4  False  False  False  False  False  False\n",
       "5  False  False  False  False  False  False\n",
       "6  False  False  False  False  False  False\n",
       "7  False  False  False  False  False  False\n",
       "8  False  False  False  False  False  False\n",
       "9  False  False  False  False  False  False"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 检查缺失值 - 返回布尔型 DataFrame\n",
    "df_with_missing = df.copy()\n",
    "df_with_missing.loc[0, '年龄'] = None\n",
    "df_with_missing.loc[1, '工资'] = None\n",
    "\n",
    "print(\"=== 缺失值检查（True表示缺失） ===\")\n",
    "df_with_missing.isnull()\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "20e31e75",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "=== 每列缺失值数量 ===\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "姓名      0\n",
       "年龄      1\n",
       "工资      1\n",
       "部门      0\n",
       "入职日期    0\n",
       "绩效评分    0\n",
       "dtype: int64"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 统计每列的缺失值数量\n",
    "print(\"=== 每列缺失值数量 ===\")\n",
    "df_with_missing.isnull().sum()\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "9900676a",
   "metadata": {},
   "source": [
    "### 5.6 `.value_counts()` - 查看值计数（适用于 Series）\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "be55e6ce",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "=== 部门分布 ===\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "部门\n",
       "技术    4\n",
       "销售    4\n",
       "人事    2\n",
       "Name: count, dtype: int64"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 查看某个列的值计数\n",
    "print(\"=== 部门分布 ===\")\n",
    "df['部门'].value_counts()\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "5d651d4f",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "=== 部门分布（包含百分比） ===\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "部门\n",
       "技术    40.0\n",
       "销售    40.0\n",
       "人事    20.0\n",
       "Name: proportion, dtype: float64"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 查看值计数（包含百分比）\n",
    "print(\"=== 部门分布（包含百分比） ===\")\n",
    "df['部门'].value_counts(normalize=True) * 100\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "63cd79a8",
   "metadata": {},
   "source": [
    "### 5.7 `.nunique()` - 查看唯一值数量\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "d4e53a53",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "=== 每列的唯一值数量 ===\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "姓名      10\n",
       "年龄      10\n",
       "工资      10\n",
       "部门       3\n",
       "入职日期    10\n",
       "绩效评分    10\n",
       "dtype: int64"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 查看每列的唯一值数量\n",
    "print(\"=== 每列的唯一值数量 ===\")\n",
    "df.nunique()\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "id": "e02696b1",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "部门列的唯一值数量: 3\n",
      "唯一部门: ['技术', '销售', '人事']\n"
     ]
    }
   ],
   "source": [
    "# 查看特定列的唯一值数量\n",
    "print(f\"部门列的唯一值数量: {df['部门'].nunique()}\")\n",
    "print(f\"唯一部门: {df['部门'].unique().tolist()}\")\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "43b91196",
   "metadata": {},
   "source": [
    "## 6. 综合示例：数据探索流程\n",
    "\n",
    "下面演示一个完整的数据探索流程，综合使用上述各种方法。\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "id": "18570c22",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "==================================================\n",
      "步骤1: 查看数据集基本信息\n",
      "==================================================\n",
      "数据集形状: (10, 6)\n",
      "行数: 10, 列数: 6\n",
      "\n"
     ]
    }
   ],
   "source": [
    "# 步骤1: 查看数据基本信息\n",
    "print(\"=\" * 50)\n",
    "print(\"步骤1: 查看数据集基本信息\")\n",
    "print(\"=\" * 50)\n",
    "print(f\"数据集形状: {df.shape}\")\n",
    "print(f\"行数: {df.shape[0]}, 列数: {df.shape[1]}\")\n",
    "print()\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "id": "78521294",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "==================================================\n",
      "步骤2: 查看前5行数据\n",
      "==================================================\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>姓名</th>\n",
       "      <th>年龄</th>\n",
       "      <th>工资</th>\n",
       "      <th>部门</th>\n",
       "      <th>入职日期</th>\n",
       "      <th>绩效评分</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>张三</td>\n",
       "      <td>25</td>\n",
       "      <td>5000</td>\n",
       "      <td>技术</td>\n",
       "      <td>2020-01-31</td>\n",
       "      <td>3.749080</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>李四</td>\n",
       "      <td>30</td>\n",
       "      <td>8000</td>\n",
       "      <td>销售</td>\n",
       "      <td>2020-02-29</td>\n",
       "      <td>4.901429</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>王五</td>\n",
       "      <td>35</td>\n",
       "      <td>12000</td>\n",
       "      <td>技术</td>\n",
       "      <td>2020-03-31</td>\n",
       "      <td>4.463988</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>赵六</td>\n",
       "      <td>28</td>\n",
       "      <td>6000</td>\n",
       "      <td>人事</td>\n",
       "      <td>2020-04-30</td>\n",
       "      <td>4.197317</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>钱七</td>\n",
       "      <td>32</td>\n",
       "      <td>9500</td>\n",
       "      <td>销售</td>\n",
       "      <td>2020-05-31</td>\n",
       "      <td>3.312037</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   姓名  年龄     工资  部门       入职日期      绩效评分\n",
       "0  张三  25   5000  技术 2020-01-31  3.749080\n",
       "1  李四  30   8000  销售 2020-02-29  4.901429\n",
       "2  王五  35  12000  技术 2020-03-31  4.463988\n",
       "3  赵六  28   6000  人事 2020-04-30  4.197317\n",
       "4  钱七  32   9500  销售 2020-05-31  3.312037"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 步骤2: 查看前几行数据，了解数据格式\n",
    "print(\"=\" * 50)\n",
    "print(\"步骤2: 查看前5行数据\")\n",
    "print(\"=\" * 50)\n",
    "df.head()\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "id": "c5f133a6",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "==================================================\n",
      "步骤3: 查看数据类型和缺失值\n",
      "==================================================\n",
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 10 entries, 0 to 9\n",
      "Data columns (total 6 columns):\n",
      " #   Column  Non-Null Count  Dtype         \n",
      "---  ------  --------------  -----         \n",
      " 0   姓名      10 non-null     object        \n",
      " 1   年龄      10 non-null     int64         \n",
      " 2   工资      10 non-null     int64         \n",
      " 3   部门      10 non-null     object        \n",
      " 4   入职日期    10 non-null     datetime64[ns]\n",
      " 5   绩效评分    10 non-null     float64       \n",
      "dtypes: datetime64[ns](1), float64(1), int64(2), object(2)\n",
      "memory usage: 608.0+ bytes\n"
     ]
    }
   ],
   "source": [
    "# 步骤3: 查看数据类型和缺失值\n",
    "print(\"=\" * 50)\n",
    "print(\"步骤3: 查看数据类型和缺失值\")\n",
    "print(\"=\" * 50)\n",
    "df.info()\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "id": "1fcf10f3",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "==================================================\n",
      "步骤4: 查看数值型列的统计摘要\n",
      "==================================================\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>年龄</th>\n",
       "      <th>工资</th>\n",
       "      <th>入职日期</th>\n",
       "      <th>绩效评分</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>count</th>\n",
       "      <td>10.000000</td>\n",
       "      <td>10.000000</td>\n",
       "      <td>10</td>\n",
       "      <td>10.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>mean</th>\n",
       "      <td>29.600000</td>\n",
       "      <td>7680.000000</td>\n",
       "      <td>2020-06-15 07:12:00</td>\n",
       "      <td>4.040273</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>min</th>\n",
       "      <td>25.000000</td>\n",
       "      <td>4800.000000</td>\n",
       "      <td>2020-01-31 00:00:00</td>\n",
       "      <td>3.116167</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25%</th>\n",
       "      <td>27.250000</td>\n",
       "      <td>5625.000000</td>\n",
       "      <td>2020-04-07 12:00:00</td>\n",
       "      <td>3.421298</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>50%</th>\n",
       "      <td>29.500000</td>\n",
       "      <td>7600.000000</td>\n",
       "      <td>2020-06-15 00:00:00</td>\n",
       "      <td>4.199773</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>75%</th>\n",
       "      <td>31.750000</td>\n",
       "      <td>9325.000000</td>\n",
       "      <td>2020-08-23 06:00:00</td>\n",
       "      <td>4.452027</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>max</th>\n",
       "      <td>35.000000</td>\n",
       "      <td>12000.000000</td>\n",
       "      <td>2020-10-31 00:00:00</td>\n",
       "      <td>4.901429</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>std</th>\n",
       "      <td>3.204164</td>\n",
       "      <td>2403.608398</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.631731</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "              年龄            工资                 入职日期       绩效评分\n",
       "count  10.000000     10.000000                   10  10.000000\n",
       "mean   29.600000   7680.000000  2020-06-15 07:12:00   4.040273\n",
       "min    25.000000   4800.000000  2020-01-31 00:00:00   3.116167\n",
       "25%    27.250000   5625.000000  2020-04-07 12:00:00   3.421298\n",
       "50%    29.500000   7600.000000  2020-06-15 00:00:00   4.199773\n",
       "75%    31.750000   9325.000000  2020-08-23 06:00:00   4.452027\n",
       "max    35.000000  12000.000000  2020-10-31 00:00:00   4.901429\n",
       "std     3.204164   2403.608398                  NaN   0.631731"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 步骤4: 查看数值型列的统计摘要\n",
    "print(\"=\" * 50)\n",
    "print(\"步骤4: 查看数值型列的统计摘要\")\n",
    "print(\"=\" * 50)\n",
    "df.describe()\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "id": "3875d0c5",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "==================================================\n",
      "步骤5: 查看分类列的分布情况\n",
      "==================================================\n",
      "部门分布:\n",
      "部门\n",
      "技术    4\n",
      "销售    4\n",
      "人事    2\n",
      "Name: count, dtype: int64\n",
      "\n",
      "部门占比:\n",
      "部门\n",
      "技术    40.0\n",
      "销售    40.0\n",
      "人事    20.0\n",
      "Name: proportion, dtype: float64\n"
     ]
    }
   ],
   "source": [
    "# 步骤5: 查看分类列的分布情况\n",
    "print(\"=\" * 50)\n",
    "print(\"步骤5: 查看分类列的分布情况\")\n",
    "print(\"=\" * 50)\n",
    "print(\"部门分布:\")\n",
    "print(df['部门'].value_counts())\n",
    "print(\"\\n部门占比:\")\n",
    "print(df['部门'].value_counts(normalize=True) * 100)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ac044968",
   "metadata": {},
   "source": [
    "## 总结\n",
    "\n",
    "### 核心方法对比\n",
    "\n",
    "| 方法 | 用途 | 返回值 |\n",
    "|------|------|--------|\n",
    "| `.head(n)` | 查看前n行 | DataFrame |\n",
    "| `.tail(n)` | 查看后n行 | DataFrame |\n",
    "| `.info()` | 查看数据类型和缺失值信息 | None（打印信息） |\n",
    "| `.describe()` | 生成描述性统计 | DataFrame |\n",
    "| `.shape` | 查看数据维度 | 元组 (行数, 列数) |\n",
    "| `.dtypes` | 查看各列数据类型 | Series |\n",
    "| `.columns` | 查看列名 | Index |\n",
    "| `.isnull()` | 检查缺失值 | 布尔型 DataFrame |\n",
    "| `.value_counts()` | 值计数 | Series |\n",
    "| `.nunique()` | 唯一值数量 | Series/int |\n",
    "\n",
    "### 建议的数据探索流程\n",
    "\n",
    "1. **`.shape`** - 了解数据集大小\n",
    "2. **`.head()` / `.tail()`** - 快速浏览数据\n",
    "3. **`.info()`** - 检查数据类型和缺失值\n",
    "4. **`.describe()`** - 了解数值分布\n",
    "5. **`.value_counts()`** - 了解分类变量分布\n",
    "6. **`.nunique()`** - 检查数据唯一性\n",
    "\n",
    "这些方法是数据分析和数据清洗的基础，熟练掌握它们能大大提高工作效率！\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "ml311",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.11.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
